package com.edu.service.food;

import com.edu.dao.FoodDao;
import com.edu.entity.Food;
import com.edu.utils.PageList;
import com.edu.utils.PageParam;

import java.sql.SQLException;
import java.util.List;

/**
 * @author ZCN
 * @version 1.0
 * @date 2021/11/19 14:58
 */
public class FoodServiceImpl implements FoodService {
    private FoodDao foodDao = new FoodDao();

    @Override
    public PageList pageList(PageParam pageParam) throws Exception {
        return foodDao.pageList(pageParam);
    }

    @Override
    public List<Food> findAll() throws SQLException {
        return foodDao.findAll();
    }

    @Override
    public List<Food> todayRecommend() throws SQLException {
        return foodDao.todayRecommend();
    }

    @Override
    public List<Food> hotsFoods() throws SQLException {
        return foodDao.hotsFoods();
    }

    @Override
    public List<Food> cookRecommend() throws SQLException {
        return foodDao.cookRecommend();
    }

    @Override
    public List<Food> hotsFoodsCom() throws SQLException {
        return foodDao.hotsFoodsComplex();
    }

    @Override
    public List<Food> cookRecommendComplex() throws SQLException {
        return foodDao.cookRecommendComplex();
    }

    @Override
    public Food findOne(Integer id) throws SQLException {
        return foodDao.findOne(id);
    }

    @Override
    public void update(Food food) throws SQLException {
        foodDao.update(food);
    }

    @Override
    public void delete(Integer id) throws SQLException {
        foodDao.delete(id);
    }

    @Override
    public void online(Integer id) throws SQLException {
        foodDao.online(id);
    }

    @Override
    public void insert(Food food) throws SQLException {
        foodDao.insert(food);
    }
}
